package polymorphicTask.Pizza;

public class PizzaFactory {
    private String name;
    public PizzaFactory(){}

    public PizzaFactory(String name){
        this.name=name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Pizza producePizza(String type){
       Pizza pizza = null;
       if (type.equals("海鲜披萨")){
           pizza=new SeafoodPizza();
       }else if (type.equals("培根披萨")){
           pizza=new BaconPizza();
       }
        return pizza;
    }
}
